IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tr_ProjectFiles_Upd]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[tr_ProjectFiles_Upd]
GO

CREATE PROCEDURE [dbo].[tr_ProjectFiles_Upd]
	@FileId UNIQUEIDENTIFIER,
	@ArchivedInd BIT = NULL,
	@DeletedInd BIT = NULL
AS

IF (NOT @ArchivedInd IS NULL)
BEGIN
	UPDATE 
		tr_File
	SET
		ArchivedInd = @ArchivedInd 
	WHERE
		FileId = @FileId
END

IF (NOT @DeletedInd IS NULL)
BEGIN
	UPDATE 
		tr_File
	SET
		DeletedInd = @DeletedInd 
	WHERE
		FileId = @FileId
END
